<?php
	header("Content-type: text/html; charset=gbk");
    include_once "dao/UserDAO.php";
    include_once "dao/TemplateDAO.php";
    include_once "dao/TaskDAO.php";
    include_once "dao/StageDAO.php";
    include_once "dao/LocationDAO.php";
    include_once "dao/ActionDAO.php";
    include_once "dao/InputDAO.php";
    include_once "dao/PictureOutputDAO.php";
    include_once "dao/TextOutputDAO.php";
    include_once "dao/UndertakeDAO.php";
    //include_once "controller/HttpUtil.php";

    $userDAO = new UserDAO();
    $taskDAO = new TaskDAO();
    $templateDAO = new TemplateDAO();
    $stageDAO = new StageDAO();
    $locationDAO = new LocationDAO();
    $actionDAO = new ActionDAO();
    $inputDAO = new InputDAO();
    $pictureDAO = new PictureOutputDAO();
    $textDAO = new TextOutputDAO();
    $undertakeDAO = new UndertakeDAO();
	$id = 1;
	$account = "test";
    $user = $userDAO->query($id);
    $user2 = $userDAO->queryByAccount($account);
    var_dump($user);
    echo "<br />";
    var_dump($user2);
    echo "<br />";
    var_dump($userDAO->queryAllUser());
    echo "<br />";
	echo "<br />";
	var_dump($userDAO->queryByWechatId("test2"));
    echo "<br />";
    var_dump($taskDAO->query($id));
    echo "<br />";
    var_dump($templateDAO->query($id));
    echo "<br />";
    var_dump($stageDAO->queryStageListByTask(2));
    echo "<br />";
    echo "<br />";
    var_dump($stageDAO->queryStageListByTask(0));
    echo ($stageDAO->queryStageListByTask(0) == null);
    echo "<br />";
    echo "<br />";
    var_dump($locationDAO->queryByStageAndType(2,1));
    echo "<br />";
    var_dump($actionDAO->queryActionListByLocation(1));
    echo "<br />";
    var_dump($inputDAO->queryInputListByAction(6));
    echo "<br />";
    var_dump($pictureDAO->queryOutputListByActionAndIndicator(4,1));
    echo "<br />";
    var_dump($textDAO->queryOutputListByActionAndIndicator(1,0));
    echo "<br />";
    var_dump($undertakeDAO->queryByUserAndStage(2,59));
    echo "<br />";
//	$result = json_decode(HttpUtil::doGet(31.196204,121.60448,31.197663,121,597219),true);
//    var_dump($result);
//	echo "<br />";
//	echo $result["status"];
//    echo "<br />";
//	var_dump($result["result"]);
//	echo "<br />";
//	$result = $result["result"][0];
//	echo $result["duration"]["value"];
?>
